<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns:tk="http://www.qdocuments.net" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.qdocuments.net" elementFormDefault="qualified">
  <xs:import schemaLocation="Report.xsd"/>
  <xs:element name="Report">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Title" type="xs:string"/>
        <xs:element name="ConditionXml" type="xs:string"/>
        <xs:element ref="tk:Execute"/>
        <xs:element ref="tk:DataTables"/>
      </xs:sequence>
      <xs:attribute name="Name" use="required" type="xs:string"/>
      <xs:attribute name="Description" type="xs:string"/>
      <xs:attribute name="Prior">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="AboveNormal"/>
            <xs:enumeration value="BelowNormal"/>
            <xs:enumeration value="Highest"/>
            <xs:enumeration value="Normal"/>
            <xs:enumeration value="Lowest"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="Execute">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element ref="tk:Calc"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Calc">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded"/>
      <xs:attribute name="Method" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="SQL"/>
            <xs:enumeration value="StoredProc"/>
            <xs:enumeration value="Code"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="TableName" use="required" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataTables">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element ref="tk:DataTable"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataTable">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="xs:anyType">
          <xs:attribute name="XmlFile" use="required" type="xs:string"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
</xs:schema>
